# 生成的新镜像以centos镜像为基础
FROM openjdk:18
# 指定作者信息
MAINTAINER by caorl

# 设置工作空间
WORKDIR /usr/local/work
# 复制nginx到镜像中,ADD会自动解压tar,xz,gzip,COPY是仅复制
ADD chapter3-1-0.0.1-SNAPSHOT.jar /usr/local/work

# 构建镜像时调用
RUN ["echo","buildingImage"]
# -y自动安装
# RUN 指令通常用于安装应用和软件包
# RUN ["yum","install","-y","net-tools"]

# 暴露端口，只是暴露出去（不写也不影响，规范还是写），容器使用还需要使用-p做端口映射
EXPOSE 8080

# CMD作为ENTRYPOINT的参数,CMD可以在docker run时覆盖，比如docker run --name test  nginx-rtmp:v1 -g "daemon off;"
# ENTRYPOINT也可以通过--entrypoint覆盖,  比如docker run --name test-name  --entrypoint=/usr/local/nginx/sbin/nginx  nginx-rtmp:v1 -g "daemon off;"
CMD ["-jar","/usr/local/work/chapter3-1-0.0.1-SNAPSHOT.jar","--spring.config.location=conf/application.properties"]
ENTRYPOINT ["java"]

